import '../public/style/components/advert.css'
import { BarChartOutlined, BookOutlined, SendOutlined } from '@ant-design/icons'

const Advert = (props) => {
  let date = new Date('2020-4-1')
  let newDate = new Date()
  let runTime = newDate.getTime() - date.getTime()
  let runDay = parseInt(runTime / 1000 / 60 / 60 / 24)

  return (
    <div className="ad-div">
      <div className="total-title">
        <BarChartOutlined className="icon-total" />
        <span className="total">站点统计</span>
      </div>
      <div className="run-search">
        <div className="totalCount">
          <BookOutlined className="icon-count" />
          文章总数：<span style={{color:'#1e90ff',marginRight:'.5rem'}}>{props.total}</span>篇
        </div>
        <div>
          <SendOutlined className="icon-count" />
          运行天数：<span style={{color:'#1e90ff',marginRight:'.5rem'}}>{runDay}</span>天
        </div>
      </div>
    </div>
  )
}

export default Advert